package summer_vacation.qiuyangyang;
import java.util.Scanner;
/**
 * Created by Administrator on 2015/8/26 0026.
 */
public class Assignment_17 {
    public static void main(String[] args) {
        int a,b,m;
        System.out.println("请输入一个整数：");
        Scanner in=new Scanner(System.in);
        b= in.nextInt();
        m = (int) b/2;
        for (a=2; a<=m; a++) {
            if (b %a== 0) {
                System.out.println("此数不为素数");
                break;
            }
        }
        if (a>m) {
            System.out.println("此数为素数");
        }
    }
}
